#ifndef RWSYNC_H
#define RWSYNC_H

class ReadersWriters
{
	public:
		ReadersWriters();
		virtual ~ReadersWriters();

		virtual bool8 initOk() = 0;

		virtual bool8 beginRead() = 0;		// false upon fatal error
		virtual void endRead() = 0;

		virtual bool8 beginWrite() = 0;		// false upon fatal error
		virtual void endWrite() = 0;

        uint32 getChangeCount();

    protected:
        uint32 m_changeCount;
};

inline
ReadersWriters::ReadersWriters()
{
    m_changeCount = 0;
}

inline
ReadersWriters::~ReadersWriters()
{
}

inline uint32
ReadersWriters::getChangeCount()
{
    return m_changeCount;
}

#endif
